﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace shapes
{
    [TestFixture]
    class Testing
    {
        double double_epsilon = 0.0000001;
        [Test]
        public void TestRectangleArea()
        {
            // шаблон триангуляция           
            Assert.AreEqual(100, (new Rectangle(10, 10)).GetArea(), double_epsilon); // квадрат
            Assert.AreEqual(15, (new Rectangle(5, 3)).GetArea(), double_epsilon);
            Assert.AreEqual(15, (new Rectangle(3, 5)).GetArea(), double_epsilon);
        }

        [Test]
        public void TestEllipseArea()
        {
            // шаблон триангуляция            
            Assert.AreEqual(78.53981633974483, (new Ellipse(10, 10)).GetArea(), double_epsilon); // квадрат
            Assert.AreEqual(157.07963267948966, (new Ellipse(10, 20)).GetArea(), double_epsilon);
            Assert.AreEqual(157.07963267948966, (new Ellipse(20, 10)).GetArea(), double_epsilon);
        }

        [Test]
        public void TestTriangleArea()
        {
            // шаблон триангуляция            
            Assert.AreEqual(43.30127018922193, (new Triangle(10, 10)).GetArea(), double_epsilon); // квадрат
            Assert.AreEqual(43.30127018922193, (new Triangle(10, 20)).GetArea(), double_epsilon);
            Assert.AreEqual(43.30127018922193, (new Triangle(20, 10)).GetArea(), double_epsilon);
        }
    }
}
